package com.pointwest.pls.domainMapper;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.pointwest.pls.dao.EmployeeDAO;
import com.pointwest.pls.dao.ProjectDAO;
import com.pointwest.pls.dao.SeatDAO;
import com.pointwest.pls.domain.Employee;
import com.pointwest.pls.domain.Project;
import com.pointwest.pls.domain.QuadrantSeat;
import com.pointwest.pls.domain.Seat;

public class DomainMapper {
	
	public Employee getEmployee(int id) throws ClassNotFoundException, SQLException, Exception {
		EmployeeDAO empDao = new EmployeeDAO();
		ProjectDAO projectDao = new ProjectDAO();
		Employee employee = new Employee();
		ArrayList<Project> projectList = new ArrayList<Project>();
		
		//employee = MapperHelper.mapEmployeeDaoToDomain(empDao.getEmployee(id));
		projectList = MapperHelper.mapProjectDaoToDomainList(projectDao.getProjectByID(id));

		return employee;
	}
	
	public Seat getSeat(int employeeId) throws ClassNotFoundException, SQLException, Exception {
		SeatDAO seatDao = new SeatDAO();
		Seat seat = new Seat();
		
		seat = MapperHelper.mapSeatDaoToDomain(seatDao.getSeatByID(employeeId));
		
		return seat;
		
	}
	
	public ArrayList<QuadrantSeat> getQuadrantSeats(String quadrant, String locationID) throws ClassNotFoundException, SQLException, Exception {
		SeatDAO seatDao = new SeatDAO();
		ArrayList<QuadrantSeat> quadrantSeats = new ArrayList<QuadrantSeat>();
		
		quadrantSeats = MapperHelper.mapQuadrantSeatDaoToDomainList(seatDao.getQuadrantMap(quadrant, locationID));
		
		return quadrantSeats;
	}
	
	public ArrayList<Project> getProject(int employeeId) throws ClassNotFoundException, SQLException, Exception {
		ArrayList<Project> projectList = new ArrayList<Project>();
		ProjectDAO projectDao = new ProjectDAO();
		
		projectList = MapperHelper.mapProjectDaoToDomainList(projectDao.getProjectByID(employeeId));
		
		return projectList;
	}
	
}
